package com.ruoyi.base.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.WxPayLogMapper;
import com.ruoyi.base.domain.WxPayLog;
import com.ruoyi.base.service.IWxPayLogService;

/**
 * 支付记录日志Service业务层处理
 * 
 * @author 刘大理
 * @date 2025-07-03
 */
@Service
public class WxPayLogServiceImpl extends ServiceImpl<WxPayLogMapper, WxPayLog> implements IWxPayLogService
{
    @Autowired
    private WxPayLogMapper wxPayLogMapper;

    /**
     * 查询支付记录日志
     * 
     * @param id 支付记录日志主键
     * @return 支付记录日志
     */
    @Override
    public WxPayLog selectWxPayLogById(Long id)
    {
        return wxPayLogMapper.selectWxPayLogById(id);
    }

    @Override
    public WxPayLog selectWxPayLogByTransactionId(String id)
    {
        return wxPayLogMapper.selectWxPayLogByTransactionId(id);
    }

    /**
     * 查询支付记录日志列表
     * 
     * @param wxPayLog 支付记录日志
     * @return 支付记录日志
     */
    @Override
    public List<WxPayLog> selectWxPayLogList(WxPayLog wxPayLog)
    {
        return wxPayLogMapper.selectWxPayLogList(wxPayLog);
    }

    /**
     * 新增支付记录日志
     * 
     * @param wxPayLog 支付记录日志
     * @return 结果
     */
    @Override
    public int insertWxPayLog(WxPayLog wxPayLog)
    {
        wxPayLog.setCreateTime(DateUtils.getNowDate());
        return wxPayLogMapper.insertWxPayLog(wxPayLog);
    }

    @Override
    public Boolean savePayLog(WxPayLog payLog) {
        return save(payLog);
    }

    /**
     * 修改支付记录日志
     * 
     * @param wxPayLog 支付记录日志
     * @return 结果
     */
    @Override
    public int updateWxPayLog(WxPayLog wxPayLog)
    {
        return wxPayLogMapper.updateWxPayLog(wxPayLog);
    }

    /**
     * 批量删除支付记录日志
     * 
     * @param ids 需要删除的支付记录日志主键
     * @return 结果
     */
    @Override
    public int deleteWxPayLogByIds(Long[] ids)
    {
        return wxPayLogMapper.deleteWxPayLogByIds(ids);
    }

    /**
     * 删除支付记录日志信息
     * 
     * @param id 支付记录日志主键
     * @return 结果
     */
    @Override
    public int deleteWxPayLogById(Long id)
    {
        return wxPayLogMapper.deleteWxPayLogById(id);
    }
}
